<script>
export default {
  name: 'PracticalAnalysisDetail',
  props: {
    // 请求参数
    requestParams: {
      type: Object,
      default: () => ({})
    },
    // 弹窗数据
    popData: {
      type: Object,
      default: () => ({})
    },
    // 弹窗配置
    popConfig: {
      type: Object,
      default: () => ({})
    },
    // 弹窗取消
    close: {
      type: Boolean,
      default: false
    },
    // 弹窗确认
    confirm: {
      type: Boolean,
      default: false
    }
  },
  watch: {
    popData: {
      async handler(data) {
        if (data.id) {
          this.formData = Object.assign({}, data)
        }
      },
      deep: true,
      immediate: true
    },
    confirm() {
      this.$emit('onFinish', 'PracticalAnalysisDetail')
    }
  },
  data() {
    return {
      formData: {}
    }
  }
}
</script>

<template>
  <div class="practical-analysis-box">
    <el-row>
      <el-col :span="6"><span class="label">数据时间:</span> {{ formData.solidifyDate }}</el-col>
      <el-col :span="6"><span class="label">项目名称: </span>{{ formData.projectName }}</el-col>
    </el-row>
    <el-row>
      <el-col :span="6"><span class="label">规划碳中和（kgCO2）:</span> {{ formData.planCarbonNeutrality }}</el-col>
      <el-col :span="6"><span class="label">实际碳中和（kgCO2）:</span> {{ formData.actualCarbonNeutrality }}</el-col>
      <el-col :span="6"><span class="label">偏差值（kgCO2）: </span>{{ formData.planCarbonNeutrality -  formData.actualCarbonNeutrality }}</el-col>
    </el-row>
    <el-row>
      <el-col :span="6"><span class="label">规划碳排（kgCO2）: </span>{{ formData.planCarbonEmissions }}</el-col>
      <el-col :span="6"><span class="label">实际碳排（kgCO2）: </span>{{ formData.actualCarbonEmissions }}</el-col>
      <el-col :span="6"><span class="label">偏差值（kgCO2）:</span> {{ formData.carbonEmissionsDeviation }}</el-col>
      <el-col :span="6"><span class="label">偏差贡献率（kgCO2）:</span> {{ formData.carbonEmissionsDeviationRate }}</el-col>
    </el-row>
    <el-row>
      <el-col :span="6"><span class="label">规划碳减（kgCO2）: </span>{{ formData.planCarbonZero }}</el-col>
      <el-col :span="6"><span class="label">实际碳减（kgCO2）: </span>{{ formData.actualCarbonZero }}</el-col>
      <el-col :span="6"><span class="label">偏差值（kgCO2）: </span>{{ formData.carbonZeroDeviation }}</el-col>
      <el-col :span="6"><span class="label">偏差贡献率（kgCO2）: </span>{{ formData.carbonZeroDeviationRate }}</el-col>
    </el-row>
    <el-row>
      <el-col :span="6"><span class="label">规划碳汇（kgCO2）:</span> {{ formData.planCarbonSequestration }}</el-col>
      <el-col :span="6"><span class="label">实际碳汇（kgCO2）: </span>{{ formData.actualCarbonSequestration }}</el-col>
      <el-col :span="6"><span class="label">偏差值（kgCO2）:</span> {{ formData.carbonSequestrationDeviation }}</el-col>
      <el-col :span="6"><span class="label">偏差贡献率（kgCO2）:</span> {{ formData.carbonSequestrationDeviationRate }}</el-col>
    </el-row>
  </div>
</template>

<style scoped lang="scss">
.practical-analysis-box {

  .el-row {
    line-height: 32px;

    .label {
      font-weight: 700;
    }
  }
}
</style>
